import { WeaLocaleProvider } from "ecCom";
const getLabel = WeaLocaleProvider.getLabel;

export function setSelectField() {
    const { store } = this;
    store.setFieldType(['select', 'select', { datas: [] }]);
    
}
export function setCheckField() {
    const { store } = this;
    store.setFieldType(['check']);
}
export function setBrowserField(valueObj1 = [], valueObj2 = []) {
    const { store } = this;
    store.setFieldType(['browser', { value: valueObj1.map(d => d.id).join(','), valueObj: valueObj1 }, { value: valueObj2.map(d => d.id).join(','), valueObj: valueObj2 }]);
}
export function setBrowserDateField() {
    const { store } = this;
    store.setFieldType(['browser', { value: '2', valueSpan: getLabel('502297', '日期') },'']);
}
export function setBrowserDptField() {
    const { store } = this;
    store.setFieldType(['browser', { value: '4', valueSpan: getLabel('502298', '部门') },'']);
}
export function setBrowserSubCompanyField() {
    const { store } = this;
    store.setFieldType(['browser', { value: '164', valueSpan: getLabel('502299', '分部') },'']);
}
export function setBrowserHrmField() {
    const { store } = this;
    store.setFieldType(['browser', { value: '1', valueSpan: getLabel('502300', '人力资源') },'']);
}

export function setInputFloatField() {
    const { store } = this;
    store.setFieldType(['input', 'float', '2']);
}

export function setInputIntField() {
    const { store } = this;
    store.setFieldType(['input', 'int']);
}

export function setInputTextField() {
    const { store } = this;
    store.setFieldType(['input', 'text', '200']);
}